﻿<UserControl x:Class="SampleModule.MefExport.AccueilContract.AccueilContractView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:converters="clr-namespace:SampleModule.Converters"
             xmlns:helpers="clr-namespace:Helpers;assembly=Helpers"
             d:DesignHeight="300"
             d:DesignWidth="300"
             mc:Ignorable="d">
    <UserControl.Resources>
        <converters:PluralizedAppelsConverter x:Key="PluralizedAppelsConverter" />
    </UserControl.Resources>

    <Grid Margin="10" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>

        <!--  Compteur  -->
        <Button Grid.Column="0" Command="{Binding OpenAppelsCommand}" Style="{StaticResource ButtonWithRedefinedTemplate}">
            <Button.Template>
                <ControlTemplate TargetType="Button">
                    <Grid
              Width="300"
              Margin="10,10,10,10"
              HorizontalAlignment="Left">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>

                        <Border Grid.Column="0"
                    Width="300"
                    Height="72"
                    HorizontalAlignment="Left"
                    VerticalAlignment="Top"
                    Background="{DynamicResource ColorThemeBrush}"
                    BorderBrush="{DynamicResource BrushBorderModule}"
                    BorderThickness="1"
                    CornerRadius="{DynamicResource CornerRadiusSize}"
                    Padding="0" x:Name="Border">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="72" />
                                </Grid.ColumnDefinitions>

                                <TextBlock Grid.Column="0"
                               Height="50"
                               Margin="15,0,15,0"
                               HorizontalAlignment="Center"
                               VerticalAlignment="Center"
                               FontSize="57"
                               FontWeight="SemiBold"
                               Foreground="White"
                               LineHeight="57"
                               LineStackingStrategy="BlockLineHeight"
                               Text="{Binding Appels.Count}"
                               TextWrapping="NoWrap" />

                                <StackPanel Grid.Column="1"
                                Margin="20,0,0,0"
                                VerticalAlignment="Center"
                                Orientation="Vertical">
                                    <TextBlock HorizontalAlignment="Left"
                                   FontSize="20"
                                   Foreground="White"
                                   Text="{Binding Appels.Count,
                                                  Converter={StaticResource PluralizedAppelsConverter}}" />
                                    <TextBlock HorizontalAlignment="Left"
                                   FontSize="14"
                                   Foreground="{DynamicResource BrushTitleModule}"
                                   Text="{helpers:Localize AccueilAppels_NonLus}" />
                                </StackPanel>

                                <Border Grid.Column="2" Background="Transparent">
                                    <Viewbox Width="22.830"
                                 Height="39.058"
                                 HorizontalAlignment="Center"
                                 VerticalAlignment="Center">
                                        <Canvas Width="22.830" Height="39.058">
                                            <Canvas>
                                                <Canvas>
                                                    <Path Data="F1 M 4.485,25.611 C 6.054,29.296 7.892,32.043 9.990,34.483 C 12.010,36.839 14.347,38.275 15.040,38.607 C 15.805,39.026 16.469,39.019 17.308,39.053 C 18.309,39.100 18.730,38.800 18.896,38.730 C 19.062,38.658 19.294,38.561 19.896,38.225 L 22.149,36.794 C 23.208,36.147 22.783,35.428 22.519,34.991 L 17.483,28.782 C 16.885,28.019 16.087,28.358 15.649,28.896 L 14.424,30.438 L 13.172,30.813 C 12.342,30.893 12.063,30.698 11.738,30.210 C 11.473,29.772 10.506,28.145 10.506,28.145 L 5.631,16.691 C 4.259,13.473 4.747,11.029 4.954,9.765 C 5.017,9.268 4.946,9.101 5.442,9.163 L 7.508,9.775 C 8.573,10.066 9.063,9.191 9.102,9.097 C 9.197,8.860 9.169,8.793 9.529,8.719 C 9.860,8.578 9.928,8.549 9.990,8.052 L 10.709,2.372 C 10.786,1.909 10.619,1.705 10.383,1.608 C 10.146,1.514 10.118,1.446 10.021,1.214 C 9.978,0.841 9.681,0.144 8.890,0.127 L 5.825,0.021 C 5.825,0.021 4.897,-0.133 3.636,0.404 C 2.239,0.999 1.178,2.000 0.609,3.340 C 0.084,4.778 -0.143,6.916 0.094,9.677 C 0.266,12.388 0.712,16.748 4.485,25.611" Fill="{DynamicResource BrushTitleModule}" />
                                                </Canvas>
                                            </Canvas>
                                        </Canvas>
                                    </Viewbox>
                                </Border>
                            </Grid>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="{DynamicResource BrushBackgroundOverButtons}" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="Border" Property="Background" Value="{DynamicResource BrushForegroundPressedButtons}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Button.Template>
        </Button>

        <!--  Ajout d'un appel  -->
        <Button Grid.Row="0"
                Grid.Column="1"
                Margin="10,10,10,0"
                HorizontalAlignment="Left"
                VerticalAlignment="Top"
                Command="{Binding CreateAppelCommand}"
                Style="{StaticResource MetroFlatButtonSteviaWithPicture}"
                Tag="{helpers:Localize Accueil_NewAppel}">
            <Button.Content>
                <Viewbox Width="22.948" Height="23.147">
                    <Canvas Width="22.948" Height="23.147">
                        <Canvas>
                            <Canvas>
                                <Path Data="F1 M 2.880,13.095 C 6.026,18.199 8.081,19.993 9.396,21.056 C 10.715,22.168 11.882,22.821 12.802,23.071 C 13.687,23.265 14.578,23.085 15.382,22.590 C 16.108,22.142 16.363,21.614 16.363,21.614 L 17.411,20.020 C 17.688,19.612 17.440,19.211 17.266,19.055 C 17.183,18.921 17.159,18.883 17.196,18.728 C 17.231,18.573 17.188,18.416 16.925,18.289 L 13.780,16.611 C 13.505,16.465 13.467,16.488 13.276,16.605 C 13.108,16.762 13.085,16.724 12.930,16.688 C 12.869,16.672 12.247,16.607 12.013,17.253 L 11.581,18.522 C 11.435,18.797 11.375,18.701 11.100,18.555 C 10.383,18.204 8.966,17.574 7.823,15.720 L 3.758,9.125 C 3.758,9.125 3.278,8.049 3.151,7.757 C 3.020,7.416 3.021,7.204 3.360,6.812 L 4.001,6.310 L 5.224,6.241 C 5.655,6.213 6.115,5.930 5.942,5.351 L 4.598,0.560 C 4.472,0.269 4.258,-0.206 3.549,0.099 L 2.012,0.730 C 1.625,0.916 1.491,0.998 1.396,1.057 C 1.300,1.115 0.996,1.223 0.660,1.748 C 0.377,2.186 0.134,2.520 0.071,3.060 C -0.009,3.531 -0.119,5.235 0.351,7.108 C 0.836,9.052 1.572,10.974 2.880,13.095" Fill="White" />
                            </Canvas>
                            <Path Data="F1 M 14.638,0.499 L 18.918,0.499 L 18.918,4.531 L 22.948,4.531 L 22.948,8.797 L 18.950,8.797 L 18.950,12.821 L 14.655,12.821 L 14.655,8.797 L 10.624,8.797 L 10.624,4.531 L 14.638,4.531 L 14.638,0.499 Z" Fill="White" />
                        </Canvas>
                    </Canvas>
                </Viewbox>
            </Button.Content>
        </Button>
    </Grid>
</UserControl>
